import { request } from '@/network/request.js'

// 发布位置签到任务   一键签到
export const clockIn = function (entity) {
    return request.post('/task/click' , entity);
}

// 发布计时位置签到任务  限时签到
export const clockInTimeOut = function (entity) {
    return request.post('/task/limit' , entity);
}

// 分页查看任务 学生
export const viewTaskForStudent = function (current, size, courseId) {
    return request.get(`/task/page?current=${current}&size=${size}&courseId=${courseId}`);
}
// 分页查看任务 教师
export const viewTaskForTeacher = function (current, size, courseId) {
    return request.get(`/task/page?current=${current}&size=${size}&courseId=${courseId}`);
}

// 结束任务
export const taskOver = function (id) {
    return request.put(`/task/end/${id}`);
}




// 查看签到 教师
export const viewSignInList = function (taskId) {
    return request.get(`/task/list/${taskId}`);
}


// // 分页查看已签到 教师
// export const viewSignInForTeacher = function (current, size, taskId) {
//     return request.get(`/clock-in/page?current=${current}&size=${size}&taskId=${taskId}`);
// }
// // 分页查看未签到 教师
// export const viewNonSignInForTeacher = function (current, size, taskId) {
//     return request.get(`/clock-in/non/page?current=${current}&size=${size}&taskId=${taskId}`);
// }
// 学生参与签到
export const signInForStudent = function (id, entity) {
    return request.post(`/task/student/${id}` , entity);
}
// 教师参与签到
export const signInForTeacher = function (id , studentId) {
    return request.post(`/task/teacher/${id}?studentId=${studentId}`);
}

// 教师撤销签到
export const signInCancelForTeacher = function (id , studentId) {
    return request.delete(`/task/teacher/${id}?studentId=${studentId}`);
}

// 查看某学生签到情况 教师
export const viewStudentSignInInfo = function (courseId ,studentId) {
    return request.get(`/task/teacher/clock-in?courseId=${courseId}&studentId=${studentId}`);
}

// 查看某学生签到情况 学生
export const viewSelfSignInInfo = function (courseId ) {
    return request.get(`/task/student/clock-in?courseId=${courseId}`);
}